package org.fordprefect.struts2jscalendarplugin.views;

import org.apache.struts2.views.TagLibrary;
import org.fordprefect.struts2jscalendarplugin.views.freemarker.tags.JSCalendarModel;
import org.fordprefect.struts2jscalendarplugin.views.velocity.components.JSCalendarDirective;
import org.fordprefect.struts2jscalendarplugin.views.velocity.components.HeadDirective;
import com.opensymphony.xwork2.util.ValueStack;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Arrays;

/**
 * Created by IntelliJ IDEA.
 * User: milmber
 * Date: Aug 7, 2007
 * Time: 10:23:06 AM
 * To change this template use File | Settings | File Templates.
 */
public class JSCalendarTagLibrary implements TagLibrary {
    
    public Object getFreemarkerModels(ValueStack valueStack, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) {
        return new JSCalendarModel(valueStack, httpServletRequest, httpServletResponse);
    }

    public List<Class> getVelocityDirectiveClasses() {
        Class[] directives = new Class[] { HeadDirective.class, JSCalendarDirective.class };
        return Arrays.asList(directives);
    }
}
